package com.hotpot.ttt.controller;

import com.hotpot.common.base.BaseController;
import com.hotpot.common.base.vm.ResultVM;
import com.hotpot.common.base.vm.SmartPageVM;
import com.hotpot.ttt.entity.DicGeneral;
import com.hotpot.ttt.service.DicGeneralService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;


/**
 * 描述：
 * @author: ruikanwang
 * @date: 2018-01-20 10:53:41
 * @version: V1.0
 * 注意：本内容仅限于新疆感知科技有限公司内部传阅,禁止外泄以及用于其他的商业目
 * Copyright © 2017-ganinfo. All rights reserved.
 */
@RestController
@RequestMapping(value = "/ttt/dicGeneral")
@Api(value ="管理",tags ="管理")
public class DicGeneralController extends BaseController<DicGeneralService,DicGeneral>{

    /**
     * 根据smarttable对象分页查询
     * @param spage
     * @return
     */
    @PostMapping("/getPageData")
    @ApiOperation(value = "查询列表")
    public ResultVM getSmartData(@RequestBody SmartPageVM<DicGeneral> spage){
        return baseGetSmartData(spage);
    }

    /**
     * 新增
     * @param entity
     * @return
     */
    @PostMapping
    @ApiOperation(value = "新增")
    public ResultVM create(@RequestBody DicGeneral entity) {
        return baseCreate(entity);
    }

    /**
     * 更新
     * @param entity
     * @return
     */
    @PutMapping
    @ApiOperation(value = "更新信息")
    public ResultVM update(@RequestBody DicGeneral entity) {
        return baseUpdate(entity);
    }

    /**
     * 根据id获取信息
     * @param pk
     * @return
     */
    @GetMapping("/{pk}")
    @ApiOperation(value = "根据主键获取信息")
    public DicGeneral getInfo(@PathVariable String pk) {
        return baseGetInfo(pk);
    }

    /**
     * 删除
     * @param pk
     * @return
     */
    @DeleteMapping("/{pk}")
    @ApiOperation(value = "根据主键删除")
    public ResultVM delete(@PathVariable String pk) {
        return baseDelete(pk);
    }



	
	
}
